package cn.ljy.mes.web.controller.backstage.mes.material;


import cn.ljy.authority.web.controller.backstage.BaseBackstageController;
import cn.ljy.common.model.result.ResponseData;
import cn.ljy.mes.model.MesMaterial;
import cn.ljy.mes.model.query.MesMaterialQuery;
import cn.ljy.mes.service.MesMaterialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "后台物料模块")
@RestController
@RequestMapping(value = "/backstage/mes/material")
public class MesMaterialController extends BaseBackstageController<MesMaterial, MesMaterialQuery,String> {

    @Autowired
    private MesMaterialService baseService;

    @Override
    public String getAuthorityPrefix() {
        return "mes:material"; // 定义模块权限前缀
    }

    @ApiOperation(value = "查询物料列表")
    @PreAuthorize("hasAuthority('mes:material:query')")
    @Override
    @GetMapping("/all")
    public ResponseData query(MesMaterialQuery mesMaterialQuery){
        return super.query(mesMaterialQuery);
    }

//    @ApiOperation(value = "分页查询物料列表")
//    @PreAuthorize("hasAuthority('mes:material:query')")
//    @Override
//    public ResponseData query(Integer page, Integer pageSize, MesMaterialQuery mesMaterialQuery){
//        return super.query(page,pageSize,mesMaterialQuery);
//    }
//
//    @ApiOperation(value = "添加物料")
//    @PreAuthorize("hasAuthority('mes:material:add')")
//    @Override
//    protected ResponseData add(@Validated({AddWorkValidation.class}) @RequestBody MesMaterial mesMaterial) {
//        return super.add(mesMaterial);
//    }
//
//    @ApiOperation(value = "读取物料指定信息")
//    @PreAuthorize("hasAuthority('mes:material:query')")
//    @Override
//    protected ResponseData get(@PathVariable String id) {
//        return super.get(id);
//    }
//
//
//    @ApiOperation(value = "编辑物料")
//    @PreAuthorize("hasAuthority('mes:material:edit')")
//    @Override
//    public ResponseData edit(@Validated({UpdateWorkValidation.class}) @RequestBody MesMaterial mesMaterial){
//        return super.edit(mesMaterial);
//    }
//
//    @ApiOperation(value = "批量删除指定的多个物料")
//    @PreAuthorize("hasAuthority('mes:material:del')")
//    @Override
//    public ResponseData deletes(String[] ids){
//        return super.deletes(ids);
//    }

}
